package com.jzo2o.foundations.controller.inner;

import com.jzo2o.api.foundations.ServeApi;
import com.jzo2o.api.foundations.dto.response.ServeAggregationResDTO;
import com.jzo2o.foundations.service.IRegionServeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/inner/serve")
@Api(tags = "内部接口 - 服务相关接口")
public class InnerServeController implements ServeApi {

    @Resource
    private IRegionServeService regionServeService;
    /**
     * 根据id查询服务项 为了订单
     *
     * @param id 服务项id
     * @return 服务项
     */
    @Override
    @GetMapping("/{id}")
    public ServeAggregationResDTO findById(@PathVariable Long id) {
        return regionServeService.getServeForOrderById(id);
    }
}
